package com.pengshun.modules.api.user.repository;

import com.pengshun.modules.domain.SystemMessage;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;


public interface SystemMessageRepository extends JpaRepository<SystemMessage, Long>, JpaSpecificationExecutor<SystemMessage> {

    /**
     * 查询用户 未读 类别消息列表
     * @param userId
     * @param CategoryId
     * @param imRead
     * @return
     */
    List<SystemMessage> findByUserIdAndCategoryIdAndImRead(Long userId,Integer CategoryId,Integer imRead);

    /**
     * 查询所有未读消息
     * @param userId
     * @param imRead
     * @return
     */
    List<SystemMessage> findByUserIdAndImRead(Long userId, Integer imRead);
}
